<template>
  <div class="bankItem">
    <ul class="bank-content">
      <li v-for="item in props.bankList" :key="item.id" @click="change(item,item.id)">
        <div class="top-content">
          <p class="bank-type">{{ item.name }}</p>
          <div class="normal" @click="change(item)">
            <svg-load name="bianji" class="bianji"></svg-load>
          </div>
        </div>
        <p class="name">{{ item.phone }}</p>
        <p v-if="item.address" class="bank">{{ item.address }}</p>
        <p v-if="item.remark" class="bank">{{ item.remark }}</p>
      </li>
    </ul>
  </div>
</template>
<script setup>
import {useRouter} from 'vue-router'
import {_t18} from "@/utils/public";
const route = useRoute()
const router = useRouter()

const props = defineProps({
  bankList: {
    type: Array,
    default: []
  }
})
const id = route.query.id
const change = (item,ids) => {
  console.log(id,'id')
    if(id){
      router.push({
        path: '/exchangedelite',
        query: {data: ids,id:id}
      })
    }else{
      router.push({
        path: '/edit-address',
        query: {data: encodeURI(JSON.stringify(item))}
      })
    }
}
</script>
<style lang="scss" scoped>
.bank-content {
  margin-top: 13px;

  li {
    display: flex;
    flex-direction: column;
    padding: 0 15px 20px 28px;
    border-bottom: 1px solid var(--ex-border-color);
    margin-top: 20px;

    &:nth-child(1) {
      margin-top: 7px;
    }

    .top-content {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      height: 15px;
      align-items: center;

      .bank-type {
        font-size: 16px;
        font-weight: bold;
        color: var(--ex-default-font-color);
        position: relative;

        .scl {
          color: var(--ex-font-color8);
          padding-left: 5px;
          font-size: 14px;
        }

        &::before {
          content: '';
          width: 3px;
          height: 100%;
          position: absolute;
          left: -10px;
          background-color: var(--ex-div-bgColor1);
          top: 0;
        }
      }
    }

    .name {
      color: var(--ex-default-font-color);
      font-size: 14px;
      padding-top: 10px;
    }

    .bankNumber {
      font-size: 20px;
      font-weight: bold;
      color: var(--ex-default-font-color);
      padding-top: 10px;
    }

    .bank {
      margin-top: 10px;
      font-size: 14px;
      color: var(--ex-passive-font-color);
    }
  }

  .bianji {
    font-size: 14px;
  }
}
</style>
